/**
 * @param {number[]} heights
 * @return {number}
 */
export var heightChecker = function (heights) {
  const heights0 = heights.slice()
  heights.sort((a, b) => a - b)
  return heights0.reduce((acc, cur, i) => acc + (cur !== heights[i] ? 1 : 0), 0)
}
